feat: implement splitInteger function tests#1036
feat: implement splitInteger function tests#1036mykhailokurochkin wants to merge 2 commits intomate-academy:mainfrom
Conversation
mykhailokurochkin
commented
Nov 8, 2025
- implement tests
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great start on the tests for the splitInteger function! The tests you've written are clear and well-structured.
However, this submission requires a few changes because it's missing three of the four specific examples outlined in the task description. To complete the task, please add tests to verify the function's output for the following cases:
splitInteger(6, 2)should return[3, 3]splitInteger(17, 4)should return[4, 4, 4, 5]splitInteger(32, 6)should return[5, 5, 5, 5, 6, 6]
Ensuring all required examples are tested is crucial for verifying the function's correctness. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| test(`should split a number into equal parts | ||
| if a value is divisible by a numberOfParts`, () => { | ||
| const result = splitInteger(10, 5); | ||
|
|
||
| expect(result).toEqual([2, 2, 2, 2, 2]); | ||
| }); | ||
|
|
||
| test(`should return a part equals to a value | ||
| when splitting into 1 part`, () => { | ||
| const result = splitInteger(8, 1); | ||
|
|
||
| expect(result).toEqual([8]); | ||
| }); | ||
|
|
||
| test('should sort parts ascending if they are not equal', () => { | ||
| const result = splitInteger(5, 2); | ||
|
|
||
| expect(result).toEqual([2, 3]); | ||
| }); | ||
|
|
||
| test('should add zeros if value < numberOfParts', () => { | ||
| const result = splitInteger(4, 5); | ||
|
|
||
| expect(result).toEqual([0, 1, 1, 1, 1]); | ||
| }); |
There was a problem hiding this comment.
Good start on the tests! However, the task description provides four specific examples to test, and your test suite is missing three of them. It's important to ensure all specified examples are covered.
Please add tests to verify the output for the following cases:
splitInteger(6, 2)should return[3, 3]splitInteger(17, 4)should return[4, 4, 4, 5]splitInteger(32, 6)should return[5, 5, 5, 5, 6, 6]
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this update! You've successfully addressed the feedback from the previous review by adding tests for all the required examples. Your test suite is now comprehensive and correctly validates the splitInteger function against the specifications. The submission fully meets all task requirements, and I am happy to approve it. Great job!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨